#include "pm/summary.h"
#include "pm/dbobject.h"
#include <wx/log.h>

using namespace pm;


Summary::Summary()
: work_request(0.0)
, cost(0.0)
, todo(0.0)
{
}

Summary::Summary(wxSQLite3ResultSet& res)
: id_project( res, wxT("id_project"),   db::ID::undefined)
, work_request(res, wxT("work_request"), 0.0)
, cost(       res, wxT("cost"),         0.0)
, todo(       res, wxT("todo"),         0.0)
{
}


GetSummaryByProject::GetSummaryByProject(const db::ID& idProject)
: id_project(idProject)
{
}
	
wxSQLite3Statement GetSummaryByProject::prepare(wxSQLite3Database& db)
{
	wxSQLite3Statement stmt =  db.PrepareStatement("select id_project, work_request, cost, todo from view_summary where id_project = ?");
	stmt.Bind(1, id_project());
	return stmt;
}
